package com.atguigu.szdz.dcsyl.common.utils;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 用于存储.las文件解析后数据的模型类
 */
public class LasFile {

    // ~Version Section
    private final Map<String, String> versionInfo = new LinkedHashMap<>();

    // ~Well Section
    private final Map<String, WellParameter> wellInfo = new LinkedHashMap<>();

    // ~Curve Section
    private final List<CurveInfo> curveInfoList = new ArrayList<>();

    // ~Parameter Section
    private final Map<String, WellParameter> parameterInfo = new LinkedHashMap<>();

    // ~Other Section
    private String otherInfo = "";

    // ~A (ASCII Data) Section
    // 使用Map来存储，键是曲线助记符 (如 "GR", "DEPTH")，值是该曲线所有深度的数据列表
    private final Map<String, List<Double>> curveData = new LinkedHashMap<>();

    // --- Getters ---
    public Map<String, String> getVersionInfo() {
        return versionInfo;
    }

    public Map<String, WellParameter> getWellInfo() {
        return wellInfo;
    }

    public List<CurveInfo> getCurveInfoList() {
        return curveInfoList;
    }

    public Map<String, WellParameter> getParameterInfo() {
        return parameterInfo;
    }

    public String getOtherInfo() {
        return otherInfo;
    }

    public void setOtherInfo(String otherInfo) {
        this.otherInfo = otherInfo;
    }

    public Map<String, List<Double>> getCurveData() {
        return curveData;
    }

    /**
     * 内部类，用于存储井、参数信息
     */
    public static class WellParameter {
        public String mnemonic;
        public String unit;
        public String value;
        public String description;

        @Override
        public String toString() {
            return String.format("Mnemonic: %s, Unit: %s, Value: %s, Description: %s",
                    mnemonic, unit, value, description);
        }
    }

    /**
     * 内部类，用于存储曲线定义信息
     */
    public static class CurveInfo {
        public String mnemonic;
        public String unit;
        public String apiCode;
        public String description;

        @Override
        public String toString() {
            return String.format("Mnemonic: %s, Unit: %s, API: %s, Description: %s",
                    mnemonic, unit, apiCode, description);
        }
    }
}